package com.lht.femalecat.bio.two;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;

/**
 * @Author:骆宏图
 * @CreateDate: 11:33 2018/7/26.
 * @Description:
 * @Modified By:
 */
public class BioClient {

    public static void main(String[] args) throws IOException {

        Socket socket = new Socket("127.0.0.1", 8080);

        PrintWriter out = new PrintWriter(socket.getOutputStream());

        out.println("nihao ");
        out.println("老王");

        out.flush();
        BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        String content = in.readLine();
        while (!content.equals("over")) {
            System.out.println(content);
            content = in.readLine();
        }
        System.out.println("交互结束");

    }

}
